package com.jxw.launcher;

import android.content.Context;
import android.support.v4.view.ViewPager;
import android.util.AttributeSet;
import android.view.MotionEvent;

/* loaded from: classes.dex */
public class NoScrollViewPager extends ViewPager {
    private boolean noScroll;
    private boolean noScrollAnim;

    public NoScrollViewPager(Context context) {
        super(context);
        this.noScroll = false;
        this.noScrollAnim = false;
    }

    public NoScrollViewPager(Context context, AttributeSet attributeSet) {
        super(context, attributeSet);
        this.noScroll = false;
        this.noScrollAnim = false;
    }

    public void setNoScroll(boolean z) {
        this.noScroll = z;
    }

    public void setScrollAnim(boolean z) {
        this.noScrollAnim = z;
    }

    @Override // android.support.v4.view.ViewPager, android.view.View
    public boolean onTouchEvent(MotionEvent motionEvent) {
        return !this.noScroll && super.onTouchEvent(motionEvent);
    }

    @Override // android.support.v4.view.ViewPager, android.view.ViewGroup
    public boolean onInterceptTouchEvent(MotionEvent motionEvent) {
        return !this.noScroll && super.onInterceptTouchEvent(motionEvent);
    }

    @Override // android.support.v4.view.ViewPager
    public void setCurrentItem(int i, boolean z) {
        super.setCurrentItem(i, z);
    }

    @Override // android.support.v4.view.ViewPager
    public void setCurrentItem(int i) {
        super.setCurrentItem(i, this.noScrollAnim);
    }
}
